Skip to content

fix: bump pytest, aiohttp, and cryptography for security CVEs#535

Merged
johnnygreco merged 3 commits intomainfrom
johnny/fix/bump-vulnerable-deps
Apr 13, 2026
Merged

fix: bump pytest, aiohttp, and cryptography for security CVEs#535
johnnygreco merged 3 commits intomainfrom
johnny/fix/bump-vulnerable-deps

Conversation

@johnnygreco
Copy link
Copy Markdown
Contributor

📋 Summary

Bump three dependencies to patch 13 known security vulnerabilities (1 High, 12 Medium) flagged by NSpect scan NSPECT-I91N-9KY3.

🔗 Related Issue

N/A — driven by NSpect security scan results.

🔄 Changes

  • Bump pytest lower bound from >=9.0.2 to >=9.0.3 in root and tests_e2e pyproject.toml (CVE-2025-71176 — High, RCE via symlink TOCTOU)
  • Add constraint-dependencies in root pyproject.toml and tests_e2e/pyproject.toml to enforce minimum safe versions for transitive deps:
    • aiohttp>=3.13.5 (10 Medium CVEs — DoS, CRLF injection, credential theft, request smuggling)
    • cryptography>=46.0.7 (CVE-2026-39892 — Medium, buffer overflow on Python >3.11)
  • Regenerate uv.lock — aiohttp 3.13.3 → 3.13.5, cryptography 46.0.6 → 46.0.7, pytest 9.0.2 → 9.0.3

🧪 Testing

  • make test passes (638 tests)
  • Unit tests added/updated — N/A, no testable logic
  • E2E tests added/updated — N/A

✅ Checklist

  • Follows commit message conventions
  • Commits are signed off (DCO)
  • Architecture docs updated — N/A

- pytest 9.0.2 → 9.0.3 (CVE-2025-71176, High — RCE via symlink TOCTOU)
- aiohttp 3.13.3 → 3.13.5 (10 Medium CVEs — DoS, CRLF injection, credential theft, request smuggling)
- cryptography 46.0.6 → 46.0.7 (CVE-2026-39892, Medium — buffer overflow on Python >3.11)

Add constraint-dependencies for transitive deps (aiohttp, cryptography) to
enforce minimum safe versions across both workspace and e2e lockfiles.
Match the 2-space indentation used throughout the file.
@johnnygreco johnnygreco requested a review from a team as a code owner April 13, 2026 14:12
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 13, 2026

Greptile Summary

Bumps pytest to >=9.0.3, and adds constraint-dependencies for aiohttp>=3.13.5 and cryptography>=46.0.7 in both the root and tests_e2e workspaces to address 13 CVEs (1 High, 12 Medium) flagged by an NSpect scan. The uv.lock correctly reflects all three version bumps and the new workspace constraints.

Confidence Score: 5/5

Safe to merge — all security bumps are correct and consistent across both workspaces; one P2 observation about lock revision.

All three package versions are correctly bumped in both pyproject.toml files and in uv.lock. The constraint-dependencies mechanism is the correct uv approach for pinning transitive deps. The only finding is a P2 note about the lock revision decreasing from 3 to 2, which may indicate a uv version mismatch with CI but does not block correctness.

uv.lock — verify the lock revision (3→2 decrease) is consistent with the uv version used in CI.

Important Files Changed

Filename Overview
pyproject.toml Adds constraint-dependencies for aiohttp>=3.13.5 and cryptography>=46.0.7 to patch 11 CVEs; bumps pytest lower bound from 9.0.2 to 9.0.3 (CVE-2025-71176)
tests_e2e/pyproject.toml Mirrors root changes: bumps pytest to >=9.0.3 and adds aiohttp/cryptography constraint-dependencies to this separate uv workspace
uv.lock All three packages correctly bumped (aiohttp 3.13.3→3.13.5, cryptography 46.0.6→46.0.7, pytest 9.0.2→9.0.3) and constraints reflected; lock revision unexpectedly decreased from 3 to 2

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[NSpect Security Scan\nNSPECT-I91N-9KY3] --> B{13 CVEs Found}
    B --> C[pytest CVE-2025-71176\nHigh - RCE via symlink TOCTOU]
    B --> D[aiohttp 10x Medium CVEs\nDoS, CRLF, credential theft,\nrequest smuggling]
    B --> E[cryptography CVE-2026-39892\nMedium - buffer overflow\nPython >3.11]
    C --> F[pytest >=9.0.3\nin pyproject.toml &\ntests_e2e/pyproject.toml]
    D --> G[constraint-dependencies\naiohttp>=3.13.5\nin both workspaces]
    E --> H[constraint-dependencies\ncryptography>=46.0.7\nin both workspaces]
    F --> I[uv.lock regenerated\naiohttp 3.13.3→3.13.5\ncryptography 46.0.6→46.0.7\npytest 9.0.2→9.0.3]
    G --> I
    H --> I
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: uv.lock
Line: 2

Comment:
**Lock file revision downgraded**

The `revision` field dropped from `3` to `2`, indicating the lock was regenerated with an older version of uv than the one that originally produced the `revision = 3` lock. If CI or other contributors use the newer uv (which writes revision 3), they will see a dirty lock on next run and either fail CI or silently regenerate it. Confirm the uv version used here aligns with the version used in CI.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (2): Last reviewed commit: "Merge branch 'main' into johnny/fix/bump..." | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown
Contributor

Code Review: PR #535 — fix: bump pytest, aiohttp, and cryptography for security CVEs

Summary

This PR bumps three dependencies to patch 13 known security vulnerabilities (1 High, 12 Medium) flagged by NSpect scan NSPECT-I91N-9KY3. The changes are minimal and well-scoped:

  • pytest >=9.0.2 to >=9.0.3 — direct dependency bump in both pyproject.toml and tests_e2e/pyproject.toml (CVE-2025-71176, High — RCE via symlink TOCTOU)
  • aiohttp >=3.13.5 and cryptography >=46.0.7 — added as constraint-dependencies in both [tool.uv] sections to pin minimum safe versions for transitive dependencies (10 Medium aiohttp CVEs + 1 Medium cryptography CVE)
  • uv.lock regenerated — only the three targeted packages changed versions; no unrelated dependency churn

Findings

Positive

  1. Correct use of constraint-dependencies: aiohttp and cryptography are transitive dependencies, so using constraint-dependencies (rather than adding them as direct dependencies) is the right uv mechanism. This enforces minimum versions without polluting the direct dependency list.

  2. Both pyproject.toml files updated consistently: The root workspace and tests_e2e/ both receive the same constraints, preventing version drift between the main workspace and the e2e test environment.

  3. Clear CVE documentation in comments: The inline comments in pyproject.toml reference specific CVE IDs and describe the vulnerability classes. This is excellent for future maintainers wondering why the constraints exist.

  4. Lock file is clean: Only the three intended packages changed versions (aiohttp 3.13.3 -> 3.13.5, cryptography 46.0.6 -> 46.0.7, pytest 9.0.2 -> 9.0.3). No unintended transitive dependency changes leaked in.

  5. CI is green: All passing checks confirm no regressions across Python 3.10-3.13 on both ubuntu and macOS (a few jobs are still pending but the vast majority have passed).

Minor Observations

  1. Lock file revision went from 3 to 2: This is a cosmetic artifact of uv lock regeneration and has no functional impact. uv uses this internally; it is not a concern.

  2. No constraint-dependencies comment in tests_e2e/pyproject.toml: The root pyproject.toml has detailed CVE comments above the constraints block, but the tests_e2e/pyproject.toml has only the generic one-liner # Minimum versions for transitive dependencies with known security vulnerabilities. without the specific CVE references. This is very minor — the root file has the details, and the e2e file mirrors it. Not blocking.

No Issues Found

  • No logic changes — purely dependency version bumps.
  • No new code paths that need tests.
  • Import direction invariants are unaffected.
  • No risk of breaking changes: all bumps are patch-level within the same minor version.

Verdict

Approve. This is a clean, well-documented security patch. The dependency bumps are correctly scoped, use the right uv mechanisms, and introduce no functional changes. CI confirms no regressions. Ship it.

@johnnygreco johnnygreco merged commit 2528741 into main Apr 13, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants